﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Pattern_Builder
{
    class Program
    {
        static void Main(string[] args)
        {
            //无Director
            //Builder builder1 = new Builder1();
            //builder1.BuildPartA();
            //builder1.BuildPartB();
            //

            //Builder2 builder2 = new Builder2();
            //builder2.BuildPartA();
            //builder2.BuildPartB();
            //Product product2 = builder2.getResult();

            //product1.Show();
            //product2.Show();

            //Builder提供接口 进一步的操作可以由Director来完成 它其实是对客户端操作的抽象
            Director diector = new Director();
            Builder builder1 = new Builder1();
            diector.Construct(builder1);
            Product product1 = builder1.getResult();

            Builder2 builder2 = new Builder2();
            diector.Construct(builder2);
            Product product2 = builder2.getResult();

            product1.Show();
            product2.Show();
        }
    }
}
